// 可以放过的路由
module.exports = (option, app) => {
    return async function auth(ctx, next) {
        /* 实现中间件 */
        console.log(new Date());
        const url = ctx.path;
        if (url == '/api/goods'||url=='/api/login') {
            await next();
        } else {
            if(ctx.cookies.get("userID")){
                await next();
            }else{
                console.log("未登录，请登录账号！");
                ctx.body = {
                    code:400,
                    msg:"未登录，请登录账号！"
                }
            }
        }
    }
}